home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_imp1control.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  184 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shw_IMPcontrol.cog
  4. #
  5. # Generic Door Script
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     
  14. #....................MESSAGES......................
  15.     message    startup        
  16.     message    crossed    
  17.     message    Timer    
  18.     message    activated        
  19.  
  20. #....................ACTORS......................
  21.     thing        player                                    local
  22.     thing        indyActor
  23.  
  24. #....................CAMERAS......................
  25.     thing        camPos
  26.  
  27. #....................PROPS......................
  28.     thing        imp_part        
  29.     thing        magicspot        
  30.             
  31. #....................TRIGGERS......................
  32.     surface        startfx0                                linkID=2
  33.     surface        startfx1                                linkID=2
  34.     surface        endfx0                                  linkID=3
  35.     surface        endfx1                                  linkID=3
  36.  
  37. #....................VARIABLES......................
  38.     int            took=0                                    local
  39.     int            lightup=0                                local
  40.     int            sndrun                                    local
  41.     
  42.     flex        rvalmin=0.0                                local
  43.     flex        gvalmin=0.1                                local
  44.     flex        bvalmin=0.0                                local
  45.     
  46.     flex        rvalmax=0.1                                local
  47.     flex        gvalmax=1.0                                local
  48.     flex        bvalmax=0.1                             local
  49.     
  50.     flex        flickertime=2                           local
  51.     flex        maxradius=0.2                           local
  52.     flex        minradius=0.2                           local
  53.     flex        radius=0.0                               local
  54.  
  55.     flex        magictime=0                                local
  56.  
  57. #....................KEYFRAMES......................
  58.     keyframe    in_reach=in_activate_medium.key            local
  59.  
  60. #....................TEMPLATES......................
  61.     template    imp_magic=imp_idlemagic                    local
  62.  
  63. #....................SOUNDS......................
  64.     sound    take_snd=sol_panel_switch_c.wav                local
  65.     sound    magic_loop=imp1_on_loop.wav                    local
  66.     sound    magic_down=imp1_powerup.wav                    local
  67.     sound    in_mystic=INXJ212.wav                        local    #"..a part of the infernal machine"
  68.     sound    in_hmm=INXJ140.wav                            local    #"..what's this?"
  69.  
  70. #....................VECTORS........................
  71.     vector      minlite                                 local
  72.     vector      maxlite                                 local
  73.     vector      zerolite                                local
  74.  
  75. end
  76.  
  77. # ========================================================================================
  78.  
  79. code
  80.  
  81. startup:
  82.     
  83.     player = GetLocalPlayerThing();
  84.     minlite = VectorSet(rvalmin, gvalmin, bvalmin);
  85.     maxlite = VectorSet(rvalmax, gvalmax, bvalmax);
  86.     zerolite= VectorSet(0.0, 0.0, 0.0);
  87.     SetThingLight(magicspot, zerolite, radius, 0.1);
  88.     return;
  89.  
  90. # ........................................................................................
  91. crossed:
  92.  
  93.     If (took == 1) return;
  94.  
  95.     If ((GetSenderID() == 2) && (GetSourceref() == player))
  96.             {
  97.                 If (lightup == 1) return;
  98.                 SetTimer(0.1);
  99.                 ThingLightAnim(magicspot, minlite, minradius, maxlite, maxradius, 2);
  100.                 sndrun=PlaySoundThing(magic_loop, magicspot, 0.5, 2, 8, 0x1);
  101.             }
  102.     
  103.     If ((GetSenderID() == 3) && (GetSourceref() == player))
  104.             {
  105.                 If (lightup == 0) return;
  106.                 SetTimer(0);
  107.                 ThingLightAnim(magicspot, zerolite, minradius, zerolite, maxradius, 0);
  108.                 If (sndrun != -1)
  109.                 {
  110.                     StopSound(sndrun, 0.25);
  111.                 }
  112.             }
  113.  
  114.  
  115. # ........................................................................................
  116. # ........................................................................................
  117. activated:
  118.  
  119.         
  120.         
  121.         if (getSenderRef() == imp_part)
  122.         {
  123.             # prep the actor in the player's spot
  124.             MakeMeStop();
  125.             DeselectWeaponWait(player);
  126.             StartCutscene(1);
  127.             CopyPlayerHolsters(player, indyActor);
  128.             CopyOrientAndPos(player, indyActor);
  129.             SetThingFlags(player, 0x80000);
  130.             ClearThingFlags(indyActor, 0x80000);
  131.  
  132.             # get camera correct
  133.             SetExtCamOffsetToThing(camPos);
  134.  
  135.             # indyActor plays keyframe and first line
  136.             PlayVoice(indyActor, in_hmm, 1.0, 1);
  137.             PlayKey(indyActor, in_reach, 4, 0x12, 0);
  138.             Sleep(0.5);
  139.             
  140.             # wipe out the magic spot and end all fx and sound
  141.             DestroyThing(imp_part);
  142.             DestroyThing(magicspot);
  143.             SetTimer(0.0);
  144.             If (sndrun != -1)
  145.             {
  146.                 StopSound(sndrun, 0.25);
  147.             }
  148.             
  149.             # add imp to inventory, second line from actor
  150.             ChangeInv(player, 14, 1);
  151.             SetInvAvailable(player, 14, 1);
  152.             JonesInvItemChanged(14);
  153.             Sleep(0.25);
  154.             PlayVoice(indyActor, in_mystic, 1.0, 1);
  155.             
  156.             # adjoin crossing no longer has any effect
  157.             took = 1;
  158.  
  159.             # return cam and player control
  160.             RestoreExtCam();
  161.             CopyOrientAndPos(indyActor, player);
  162.             ClearThingFlags(player, 0x80000);
  163.             SetThingFlags(indyActor, 0x80000);
  164.             EndCutScene();
  165.             ClearActorFlags(player, 0x200000);
  166.         }
  167. return;
  168.  
  169.         
  170. # ........................................................................................
  171. Timer:
  172.  
  173. CreateThing(imp_magic, magicspot);
  174.  
  175. magictime=Rand();
  176.  
  177. SetTimer((magictime + 1.5));
  178.  
  179. return;
  180. # ........................................................................................
  181.  
  182. end
  183.  
  184.